package Menus
{	
	import Utils.Key;
	
	import flash.display.Bitmap;
	
	public class MainMenu extends BaseMenu
	{		
		public function MainMenu(game:Game, bitmap:Bitmap)
		{
			super(game, bitmap);
			this.name = "Main";
			this.maxChoices = 3;
			testOutput.text = "Start Game";
			this.addChild(testOutput);
		}
		
		public override function HandleInput(keyCode:uint):void
		{
			switch(keyCode)
			{
				case Key.UP:
					if(MenuChoice == 0)
					{
						MenuChoice = maxChoices - 1;
					}
					else
					{
						MenuChoice--;
					}
					break;
				case Key.DOWN:
					if(MenuChoice == maxChoices - 1)
					{
						MenuChoice = 0;
					}
					else
					{
						MenuChoice++;
					}
					break;
				case Key.ENTER:
					switch(MenuChoice)
					{
						case 0:
							this.Hide();
							game.LoadGame();
							break;
						case 1:
							this.Hide();
							game.UnPauseGame();
							break;
					}
					break;
			}
		}
		
		
		protected override function menuChoiceChanged():void
		{
			switch(menuChoice)
			{
				case 0:testOutput.text = "Start Game";break;
				case 1:testOutput.text = "Load Game";break;
				case 2:testOutput.text = "Select Character";break;
			}
		} 
	}
}